﻿using SAIM.Models.BLL;
using SAIM.Models.DAL;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace SAIM.Models
{
    public class SocialServiceViewModel
    {
        [Required(AllowEmptyStrings = false, ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Name")]
        public string StudentName { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "BirthDate")]
        public string BirthDate { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Address")]
        public string Address { get; set; }
        

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Cellphone")]
        public string CellPhoneNumber { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "StudentPhoneNumber")]
        public string StudentPhoneNumber { get; set; }
              
        //[Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "StayModality")]
        public string StayModality { get; set; }

        //[Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "StayModalityGrade")]
        public string StayModalityGrade { get; set; }

       // [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "StayModalityType")]
        public string StayModalityType { get; set; }
        
        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "UniqueKey")]
        public long StudentId { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [EmailAddress(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "InvalidEmailAddress")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Email")]
        public string Email { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "InsuranceNumber")]
        public string InsuranceNumber { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "InsuranceType")]
        public string InsuranceType { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "AcademicEntity")]
        public string School { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Career")]
        public string Career { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Semester")]
        public int? Semester { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "ProjectOfTheStay")]
        public string Project { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "ResponsibleStaff")]
        public string ResponsiblePerson { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "ActivitiesLaboratories")]
        public string ActivitiesLaboratories { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "ActivitiesToDo")]
        public string ActivitiesToDo { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "InitialDate")]
        public string InitialDate { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "EndDate")]
        public string EndDate { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "CheckInTime")]
        public string CheckInTime1 { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "DepartureTime")]
        public TimeSpan? DepartureTime1 { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "CheckInTime")]
        public string CheckInTime2 { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "DepartureTime")]
        public TimeSpan? DepartureTime2 { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "ResponsibleForSocialService")]
        public string ResponsibleSocialService { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "BloodType")]
        public string BloodType { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Asthma")]
        public string Asthma { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Diabetes")]
        public string Diabetes { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Headache")]
        public string Headache { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Epilepsy")]
        public string Epilepsy { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "DigestiveProblems")]
        public string DigestiveProblems { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "CardiacAfections")]
        public string CardiacAfections { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "VisionAffections")]
        public string VisionAffections { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "SkinAffections")]
        public string SkinAffections { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "RespiratoryProblems")]
        public string RespiratoryProblems { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Disability")]
        public string Disability { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Allergies")]
        public string Allergies { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Hypertension")]
        public string Hypertension { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Specials")]
        public string Specials { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "LastTetanusVaccine")]
        public string LastTetanusVaccine { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "SpecialMedicationText")]
        public string SpecialMedicationText { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Relationship")]
        public string PrimaryContactRelationship { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Name")]
        public string PrimaryContactName { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Address")]
        public string PrimaryContactAddress { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "PrimaryContactPhone")]
        public string PrimaryContactPhone { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Cellphone")]
        public string PrimaryContactCellphone { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Relationship")]
        public string SecundaryContactRelationship { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Name")]
        public string SecundaryContactName { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Address")]
        public string SecundaryContactAddress { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "PrimaryContactPhone")]
        public string SecundaryContactPhone { get; set; }

        [Display(ResourceType = typeof(SAIM.Resources.Site), Name = "Cellphone")]
        public string SecundaryContactCellphone { get; set; }

        [Required(ErrorMessageResourceType = typeof(SAIM.Resources.Validations), ErrorMessageResourceName = "FieldRequired")]
        public int CurrentPage { get; set; }
    }

    public class SocialServiceStudents
    {
        public int current { get; set; }
        public int rowCount { get; set; }
        public int total { get; set; }
        public List<StudentInfo> rows;

        public SocialServiceStudents()
        {
            rows = new List<StudentInfo>();
        }
    }

    public class StudentInfo
    {
        public string SocialServiceId { get; set; }
        public long StudentId { get; set; }
        public string InitialDate { get; set; }
        public string EndDate { get; set; }
        public string StudentName { get; set; }
        public string StayModality { get; set; }
        public string StayModalityGrade { get; set; }
        public string StayModalityType { get; set; }
    }
}